import React, { memo } from 'react'
import { useNavigate } from 'react-router-dom'

const Navbar = memo((props) => {
    let { right, title, left } = props
    let navigate = useNavigate()
    return (
        <div style={{ display: 'flex', justifyContent: "space-between", alignItems: 'center' }}>
            <p onClick={() => navigate(-1)}>{right || '<'}</p>
            <p>{title || '标题'}</p>
            <p>{left || ''}</p>
        </div>
    )
})

export default Navbar